/**
 *
 * */

const str = "name=kerwin&age=100&location=dalian"

const querystring = require("querystring")

const obj =  querystring.parse(str)

console.log(obj)

const myObj = {
  a: 1,
  b: 2,
  c: 3
}

const myStr = querystring.stringify(myObj)
console.log(myStr)


const str1 = "name=kerwin&city=北京&location=dalian"
const escaped = querystring.escape(str1)
console.log(escaped)

const str2 = 'name%3Dkerwin%26city%3D%E5%8C%97%E4%BA%AC%26location%3Ddalian'
const unescape = querystring.unescape(str2)
console.log(unescape)
